using System.Windows.Input;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Keyboard = Microsoft.Xna.Framework.Input.Keyboard;

namespace Silverlight3dApp.Learning.Lesson07
{
    public class MadnessGame : Game
    {
        private Camera _camera;
        private ModelManager _modelManager;

        public Camera Camera
        {
            get
            {
                return _camera;
            }
        }

        protected override void Initialize()
        {
            _camera = new Camera(this, new Vector3(0, 0, 50), new Vector3(0, 0, 0), Vector3.Up);
            Components.Add(_camera);
            _modelManager = new ModelManager(this);
            Components.Add(_modelManager);
            base.Initialize();
        }

        protected override void LoadContent()
        {
            base.LoadContent();
        }

        protected override void UnloadContent()
        {
            base.UnloadContent();
        }

        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            if (GraphicsDevice.RasterizerState.CullMode != CullMode.None)
            {
                GraphicsDevice.RasterizerState = new RasterizerState
                                                     {
                                                         CullMode = CullMode.None
                                                     };
            }
            GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Colors.CornflowerBlue, 1.0f, 0);

            base.Draw(gameTime);
        }
    }
}